package com.example.hello_world.fragments2;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.hello_world.R;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link inFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class inFragment extends Fragment {

   private String tittle;
    private TextView tv;

    public inFragment() {
        // Required empty public constructor
    }


    public static inFragment newInstance( String mtitle) {
        inFragment fragment = new inFragment();
        fragment.tittle=mtitle;
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view= inflater.inflate(R.layout.fragment_in, container, false);
        tv=view.findViewById(R.id.tv);
        tv.setText(tittle);
        return view;
    }

}